home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 May / PCWMAY06.iso / Software / Freeware / First Page 2006 3.00 / fp2006-final-3.00-setup.exe / {app} / Iscripts / Equivalents / instance-counter.izs < prev    next >
Text File  |  2005-09-27  |  3KB  |  93 lines

  1. <!NOWIZARD>
  2.  
  3. <!TITLE>Instance Counter 
  4. <!/TITLE>
  5.  
  6. <!DESCRIPTION>This script doesnt only count the words but it can also count how many times the word is used!<!/DESCRIPTION> 
  7.  
  8. <!CATEGORY>Equivalents<!/CATEGORY>
  9.  
  10. <!SCRIPT>
  11. <!-- START OF SCRIPT -->
  12.  
  13. <!-- HOW TO INSTALL INSTANCE COUNTER:
  14.  
  15.   1.  Copy code into the HEAD section of document
  16.   2.  Put last coding into the BODY section of document  -->
  17.  
  18. <!-- STEP ONE: Add code into HEAD section of document  -->
  19.  
  20. <HEAD>
  21.  
  22. <!-- Original:  Philip Peterson (IronMagma@hotmail.com) -->
  23. <!-- Web Site:  http://www.ironmagma.tk -->
  24. <script language=javascript>
  25. <!--
  26. function countInstances(element,word) {
  27. montage=element.split(word).length-1;
  28. if(montage==0){montage="no"}
  29. if(montage==1){alert("The selection specified contains 1 instance of the phrase \""+word+"\".")}
  30. else{alert("The selection specified contains "+montage+" instances of the phrase \""+word+"\".")}
  31. }
  32. //-->
  33. </script>
  34. </HEAD>
  35.  
  36. <!-- STEP TWO: Add code into BODY section of document  -->
  37.  
  38. <BODY>
  39.  
  40.  
  41. <!-- Original:  Philip Peterson (IronMagma@hotmail.com) -->
  42. <!-- Web Site:  http://www.ironmagma.tk -->
  43. <textarea id=area>This is where your text goes.  It will search for instances of 'text'</textarea>
  44. <input type=submit onClick="countInstances(document.all.area.value,'text')" value="Count!">
  45.  
  46.  
  47. <!-- END OF SCRIPT -->
  48. <!/SCRIPT>
  49.  
  50. <!PREVIEW>
  51. <!-- START OF SCRIPT -->
  52.  
  53.  
  54.  
  55. <!-- HOW TO INSTALL INSTANCE COUNTER:
  56.  
  57.   1.  Copy code into the HEAD section of document
  58.   2.  Put last coding into the BODY section of document  -->
  59.  
  60. <!-- STEP ONE: Add code into HEAD section of document  -->
  61.  
  62. <HEAD>
  63.  
  64. <!-- Original:  Philip Peterson (IronMagma@hotmail.com) -->
  65. <!-- Web Site:  http://www.ironmagma.tk -->
  66. <script language=javascript>
  67. <!--
  68. function countInstances(element,word) {
  69. montage=element.split(word).length-1;
  70. if(montage==0){montage="no"}
  71. if(montage==1){alert("The selection specified contains 1 instance of the phrase \""+word+"\".")}
  72. else{alert("The selection specified contains "+montage+" instances of the phrase \""+word+"\".")}
  73. }
  74. //-->
  75. </script>
  76. </HEAD>
  77.  
  78. <!-- STEP TWO: Add code into BODY section of document  -->
  79.  
  80. <BODY>
  81.  
  82.  
  83. <!-- Original:  Philip Peterson (IronMagma@hotmail.com) -->
  84. <!-- Web Site:  http://www.ironmagma.tk -->
  85. <textarea id=area>This is where your text goes.  It will search for instances of 'text'</textarea>
  86. <input type=submit onClick="countInstances(document.all.area.value,'text')" value="Count!">
  87.  
  88.  
  89. <!-- END OF SCRIPT -->
  90. <!/PREVIEW>
  91.  
  92. <!RELATED>NONE<!/RELATED>
  93.